import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * This is a class that has the method move used by their subclasses.
 * 
 * @author Manuel Nava
 * @version 1.0
 */
public class PowerUp extends Actor
{
    /**
     * The method act is empty.
     */
   public void act() 
    {
        // Add your action code here.
    }  
    
    public void move()
    {
       if(((CaveWorld)(getWorld())).getCont()>0)
       {
        if(Greenfoot.isKeyDown("left")&&((CaveWorld)(getWorld())).getMove()==true)
            setLocation(getX()+5,getY());
        if(Greenfoot.isKeyDown("right")&&((CaveWorld)(getWorld())).getMove()==true)
            setLocation(getX()-5,getY());
        }
    }
}
